import 'package:flutter_test/flutter_test.dart';
import 'package:tuya_home_flutter/tuya_home_flutter.dart';
import 'package:tuya_home_flutter/tuya_home_flutter_platform_interface.dart';
import 'package:tuya_home_flutter/tuya_home_flutter_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockTuyaHomeFlutterPlatform
    with MockPlatformInterfaceMixin
    implements TuyaHomeFlutterPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final TuyaHomeFlutterPlatform initialPlatform = TuyaHomeFlutterPlatform.instance;

  test('$MethodChannelTuyaHomeFlutter is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelTuyaHomeFlutter>());
  });

  test('getPlatformVersion', () async {
    TuyaHomeFlutter tuyaHomeFlutterPlugin = TuyaHomeFlutter();
    MockTuyaHomeFlutterPlatform fakePlatform = MockTuyaHomeFlutterPlatform();
    TuyaHomeFlutterPlatform.instance = fakePlatform;

    expect(await tuyaHomeFlutterPlugin.getPlatformVersion(), '42');
  });
}
